import logIP from "@/app/www/media/logIP"; import { wantComment, wantEssay } from "@/app/www/logic/want"; export const GET = logIP( async ( { nextUrl: { searchParams } }, { params: { wantVariety, textInput } }, ) => { const page = searchParams.get("page"); if (!page) { return new Response(undefined, { status: 400 }); } switch (wantVariety) { case "essay": return Response.json(await wantEssay(textInput, Number(page), 10)); case "comment": return Response.json(await wantComment(textInput, Number(page), 10)); default: return new Response(undefined, { status: 400 }); } }, );